package com.njitweb.mapper;

import com.njitweb.pojo.Goods;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GoodMapper {

    @Insert("insert into product (name, description, price, stock, category_id, image_url, status) " +
            "values (#{name},#{description},#{price},#{stock},#{categoryId},#{imageUrl},#{status})")
    void addGood(Goods good);

//    @Select("select * from  product")
    List<Goods> listGoods();

    void deleteById(Integer id);

    void modifyStatus(@Param("id") Integer id, @Param("status") Integer status);
}
